package com.joeshing.security.model;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.FullTextFilterDef;
import org.hibernate.search.annotations.FullTextFilterDefs;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

import com.joeshing.base.search.BestDriversFilter;
import com.joeshing.base.search.SecurityFilterFactory;

@Entity
@Table(name = "cost_sys_log")
@Indexed
@FullTextFilterDefs({ @FullTextFilterDef(name = "bestDriver", impl = BestDriversFilter.class), @FullTextFilterDef(name = "security", impl = SecurityFilterFactory.class) })
public class SysLog  implements java.io.Serializable {

	private static final long serialVersionUID = 9033415883739604544L;
	private String id;
	private String operator;
	private String ip;
	private String time;
	private String url;
	private String content;
	private String result;
	private String remark;
	private int level;
	private String action;
	private String method;

    public SysLog() {

    }

   
	public SysLog(String id, String operator, String ip, String time, String url, String content, int level,
			String action) {
		this.id = id;
		this.operator = operator;
		this.ip = ip;
		this.time = time;
		this.url = url;
		this.content = content;
		this.level = level;
		this.action = action;
	}

	public SysLog(String id, String operator, String ip, String time, String url, String content, String result,
			String remark, int level, String action, String method) {
		this.id = id;
		this.operator = operator;
		this.ip = ip;
		this.time = time;
		this.url = url;
		this.content = content;
		this.result = result;
		this.remark = remark;
		this.level = level;
		this.action = action;
		this.method = method;
	}

	@Id
	@GeneratedValue(generator="hibernate-uuid")
	@GenericGenerator(name="hibernate-uuid",strategy="uuid.hex")
    @Column(name="id", unique=true, nullable=false, length=32)
	@DocumentId
    public String getId() {
        return this.id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    

    @Column(name="operator", nullable=false)
    @Field(store = Store.YES)
    public String getOperator() {
        return this.operator;
    }
    
    public void setOperator(String operator) {
        this.operator = operator;
    }

	@Field(store = Store.YES)
	@Column(name = "ip", nullable = false)
    public String getIp() {
        return this.ip;
    }
    
    public void setIp(String ip) {
        this.ip = ip;
    }

	@Field(store = Store.YES)
	@Column(name = "time")
	public String getTime() {
        return this.time;
    }
    
	public void setTime(String time) {
        this.time = time;
    }
    
	@Column(name = "url", nullable = false, length = 4000)
	@Field(store = Store.YES)
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    
	@Column(name = "content", length = 4000)
	@Field(store = Store.YES)
    public String getContent() {
        return this.content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
	@Column(name = "result")
	@Field(store = Store.YES)
    public String getResult() {
		return result;
	}


	public void setResult(String result) {
		this.result = result;
	}


	@Column(name = "remark", length = 4000)
	@Field(store = Store.YES)
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    
	@Column(name = "level", nullable = false)
	@Field(store = Store.YES)
    public int getLevel() {
        return this.level;
    }
    
    public void setLevel(int level) {
        this.level = level;
    }

	@Column(name = "action", length = 400)
	@Field(store = Store.YES)
	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	@Column(name = "method", length = 64)
	@Field(store = Store.YES)
	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

}


